#include <iostream>

using namespace std;

int a[30][30];
int d[8][2] = {{-1, -1}, {-1, 0}, {-1, 1}, {0, -1}, {0, 1}, {1, -1}, {1, 0}, {1, 1}};

int main()
{
    freopen("011.in", "r", stdin);
    freopen("011.out", "w", stdout);
    
    memset(a, 0, sizeof(a));
    for (int i = 3; i <= 22; i++)
        for (int j = 3; j <= 22; j++) cin >> a[i][j];
        
    int max = 0;
    for (int i = 3; i <= 22; i++)
        for (int j = 3; j <= 22; j++)
            for (int k = 0; k < 8; k++)            
            {
                cout << i << " " << j << " ";
                int product = 1;
                for (int t = 0; t < 4; t++) product *= a[i + t*d[k][0]][j + t*d[k][1]];
                cout << product << endl;
                if (product > max) max = product;
            }   
            
    cout << max << endl;
    getchar();

    return 0;
}
